package com.CmJava.configuration;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;


//开启事务支持后，然后在访问数据库的Service方法上添加注解 @Transactional 便可。
@EnableTransactionManagement
@Configuration
// 扫描mapper
@MapperScan("com.CmJava.mapper")
public class WebAppConfig{

    // 分页插件
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }


}
